From 74df4618de1c52c22f892e0bf82ec612521a10c0 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 26 Oct 2014 22:56:02 +0100 Subject: BioGenGrown: Smaller biomes, add land to map center. --- src/Generating/BioGen.cpp | 6 ++---- src/Generating/IntGen.h | 23 +++++++++++------------ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp index c9405040f..fcb4d74ed 100644 --- a/src/Generating/BioGen.cpp +++ b/src/Generating/BioGen.cpp @@ -969,10 +969,8 @@ public: std::make_shared> (a_Seed + 2000, 70, std::make_shared> (a_Seed + 1004, std::make_shared> (a_Seed + 10, - std::make_shared> (a_Seed + 2003, 50, - std::make_shared> (a_Seed + 11, - std::make_shared> (a_Seed + 100, 65 - )))))))))))))))))))))))))))))); + std::make_shared> (a_Seed + 100, 65 + )))))))))))))))))))))))))))); m_Gen = std::make_shared>(a_Seed, diff --git a/src/Generating/IntGen.h b/src/Generating/IntGen.h index a0064715f..1eb20711d 100644 --- a/src/Generating/IntGen.h +++ b/src/Generating/IntGen.h @@ -124,7 +124,7 @@ public: } - virtual void GetInts(int a_MinX, int a_MinZ, typename Values & a_Values) override + virtual void GetInts(int a_MinX, int a_MinZ, typename super::Values & a_Values) override { for (int z = 0; z < SizeZ; z++) { @@ -146,13 +146,13 @@ public: Has a threshold (in percent) of how much land, the larger the threshold, the more land. Generates 0 for ocean, biome group ID for landmass. */ template -class cIntLandOcean : +class cIntGenLandOcean : public cIntGenWithNoise { typedef cIntGenWithNoise super; public: - cIntLandOcean(int a_Seed, int a_Threshold) : + cIntGenLandOcean(int a_Seed, int a_Threshold) : super(a_Seed), m_Threshold(a_Threshold) { @@ -170,6 +170,12 @@ public: a_Values[x + SizeX * z] = ((rnd % 100) < m_Threshold) ? ((rnd / 128) % bgMax + 1) : 0; } } + + // If the centerpoint of the world is within the area, set it to bgTemperate, always: + if ((a_MinX <= 0) && (a_MinZ <= 0) && (a_MinX + SizeX > 0) && (a_MinZ + SizeZ > 0)) + { + a_Values[-a_MinX - a_MinZ * SizeX] = bgTemperate; + } } protected: @@ -451,12 +457,12 @@ public: { for (int x = 0; x < SizeX; x++) { - if (a_Values[x + z * SizeX] == 0) + if (a_Values[x + z * SizeX] == bgOcean) { int rnd = m_Noise.IntNoise2DInt(a_MinX + x, a_MinZ + z) / 7; if (rnd % 100 < m_Threshold) { - a_Values[x + z * SizeX] = (rnd / 100) % 4; + a_Values[x + z * SizeX] = (rnd / 100) % bgMax; } } } @@ -511,13 +517,6 @@ public: int Right = Cache[x + 2 + (z + 1) * m_UnderlyingSizeX]; switch (v) { - // Oceans don't need any edges: - case bgOcean: - { - v = bgOcean; - break; - } - // Desert should neighbor only oceans, desert and temperates; change to temperate when another: case bgDesert: { -- cgit v1.2.3